UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NFEIcXS+Htke05iH7508WsIwHIgVUps0LY4YRaTPaEE='
WHERE
key_id = 'cc54fe5ccaadd9619026f5e57be8ff0200d202d511b8d95ca4ae4b185801a63d'
AND (
token = 'NFEIcXS+Htke05iH7508WsIwHIgVUps0LY4YRaTPaEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)