UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SQsR5SezzBRChSyVQOIwnnoiZonFvfP81huf4B93dLI='
WHERE
key_id = 'd4c8e7f2644f1ea61f4ade2f20f90fe32b994dc65d8ce7b2677f3e39c64dbd72'
AND (
token = 'SQsR5SezzBRChSyVQOIwnnoiZonFvfP81huf4B93dLI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)