UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7BUV0LQnAlYIk98AvBMrc+5oDOPZqzMAAt2hyZ0Gq28='
WHERE
key_id = 'c70ed1f07d24aab8fb595d2d6486626fa62f3f39b5a194c01ffde6c42206bd4b'
AND (
token = '7BUV0LQnAlYIk98AvBMrc+5oDOPZqzMAAt2hyZ0Gq28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)