UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8RpKQ67eNP6W6KvOOdoSkB+ZKFPMSZZY63YZAWm70Ag='
WHERE
key_id = '566235fa7e288e596eada27a2bf5442025e1e0b6315e09d89b7703e0ca8af8d1'
AND (
token = '8RpKQ67eNP6W6KvOOdoSkB+ZKFPMSZZY63YZAWm70Ag='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)