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