UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8ZpCretlqN5V6Y/WzK7N7RTmNNr8bjdL+lL7ee3LSJc='
WHERE
key_id = 'de7f89bfc8db57f1df2c90bd74af75dfa4de49d91f9a4aff57c71f5947c97ad3'
AND (
token = '8ZpCretlqN5V6Y/WzK7N7RTmNNr8bjdL+lL7ee3LSJc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)