UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r8Uazi47ZaEWfp2PIn48SUJotGE/NF/UDrV+X3QLwGo='
WHERE
key_id = 'c603a6453f30706ddd6219990c7d0400c41ebfc58e39ad74d375e43000d7cbb3'
AND (
token = 'r8Uazi47ZaEWfp2PIn48SUJotGE/NF/UDrV+X3QLwGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)