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