UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ifrPjk6EIH6jOERGPqbx2MieZqnwPmgMny+xRMB8CC4='
WHERE
key_id = '882c248abc921b970abb98478e8e4fff42bc69e2930ef057509ef0143fa31eaf'
AND (
token = 'ifrPjk6EIH6jOERGPqbx2MieZqnwPmgMny+xRMB8CC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)