UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mJqI86XkDyyTq+AhXQVv0Af7I+tB0numxOPWra2UAbI='
WHERE
key_id = '8c680b46c99a3f3af51a3199299dd124a73238e97f045d61efbff418177517a1'
AND (
token = 'mJqI86XkDyyTq+AhXQVv0Af7I+tB0numxOPWra2UAbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)