UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4hGpFM9IMr47G8TkhrrsiH4GMOI6nl/uOiTP0HjiVDY='
WHERE
key_id = 'c587a87f81f43d534a2495b78e6b75bd4460e516d282856519f86a3dc8cfb283'
AND (
token = '4hGpFM9IMr47G8TkhrrsiH4GMOI6nl/uOiTP0HjiVDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)