UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wuv934ptZvSCOLWsMBv4gdedT2cDtIEgv0XsIZM6CDg='
WHERE
key_id = 'f77cf9f022ad722422959e54b1cc315fbfa1d8bd97b336ee594506169decc57e'
AND (
token = 'Wuv934ptZvSCOLWsMBv4gdedT2cDtIEgv0XsIZM6CDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)