UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pQkJvK9B2Me5bKQSGFtBihp+D0e7KRM6QFymMtq30fI='
WHERE
key_id = 'cb9cfd0f087dbc7e90e84c99c3954b8f94467c839d98767cd5e58b14fa4d0a62'
AND (
token = 'pQkJvK9B2Me5bKQSGFtBihp+D0e7KRM6QFymMtq30fI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)