UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0RusG28Dkp0NU5/99Mi/i77/bqRv2J9WDfL2ry2sN6I='
WHERE
key_id = '211f0b862a9924a5a68824e232daedfee5d6e636925647382e5c257b4ffa2d31'
AND (
token = '0RusG28Dkp0NU5/99Mi/i77/bqRv2J9WDfL2ry2sN6I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)