UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kIFFXV0+dZZ/zZoiM0h1wkKCEz95CIE2d2vpGf9e4V0='
WHERE
key_id = 'ee874bfae079fbc0c1d3ad0b8a770b3989a77178875f69264d3d2e33eaf5e212'
AND (
token = 'kIFFXV0+dZZ/zZoiM0h1wkKCEz95CIE2d2vpGf9e4V0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)