UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MbmnyPqzjKdJFHFWXzOabcEbbjgTjwmnIx8rCjUrI1A='
WHERE
key_id = '0bd6ea47410bfa893a5b7ae864ea1ab1c4a8656f26c6b7f7dc6a538bc3210712'
AND (
token = 'MbmnyPqzjKdJFHFWXzOabcEbbjgTjwmnIx8rCjUrI1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)