UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ivuh/nZbOdzZ/+/+M/uIVW0aIkss+dgrQqAzQkwyKbI='
WHERE
key_id = 'e96647a305c0cd66e135cb9c508ad5d8b4f0feb4ab2a3332b88070a255e94a5a'
AND (
token = 'Ivuh/nZbOdzZ/+/+M/uIVW0aIkss+dgrQqAzQkwyKbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)