UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VEkERbQV3OcvZk2i4o/aS9TCi9fO/WCeG9VUzUCNOrk='
WHERE
key_id = '130d9f21660da049741b26dd9d25e35d1c7f604561b4b788d79b5a3c09b02d90'
AND (
token = 'VEkERbQV3OcvZk2i4o/aS9TCi9fO/WCeG9VUzUCNOrk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)