UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SpV5lrnkt4pFP4NuP0PZ6SbmeNOwh1zv6AcgB78ToFU='
WHERE
key_id = '26af5cb9f32188c04b453fa087d8aa2b438327f1b21363f986adc54e55f1c641'
AND (
token = 'SpV5lrnkt4pFP4NuP0PZ6SbmeNOwh1zv6AcgB78ToFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)