UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QOikkXdJJvKKlgND5UTWUSBp14uEAjo8Ok8k2sdEbpU='
WHERE
key_id = '73e2e782c26f54e8f6ee1d3cd754d6a21a9dcc09c0b1885586fef76c36e3c7a1'
AND (
token = 'QOikkXdJJvKKlgND5UTWUSBp14uEAjo8Ok8k2sdEbpU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)