UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rNJF2xCmk+i3su2h9WYopmd/FVJp113HU/c+Cc3t6F0='
WHERE
key_id = '1fc17e10db366a64163ff0f20745ae80d058c265920a2cea68a28ec566b98770'
AND (
token = 'rNJF2xCmk+i3su2h9WYopmd/FVJp113HU/c+Cc3t6F0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)