UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Dqdyik0DkwO+EPEV0EP6st0oLrmszMjYBXZ9WkuehU='
WHERE
key_id = 'c3648d4158f6acb6357c270a011ec1c9371a71c26e5bb4df7d558bb627c845f8'
AND (
token = '4Dqdyik0DkwO+EPEV0EP6st0oLrmszMjYBXZ9WkuehU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)