UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BzME2OCfj+LlkStbqVdYNtBa7QKjTF++EAm29X77Xps='
WHERE
key_id = '6901fb4fca4a41a1dca64430b8c6617505814d437bfaf9b3b10b73335e5f288d'
AND (
token = 'BzME2OCfj+LlkStbqVdYNtBa7QKjTF++EAm29X77Xps='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)