UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WHVLjfqMMga8EUDmu5LC4gbeOpy8Ujtuk7zMaijLhkQ=' 
WHERE 
  key_id = '791d8cdfb2ba11b1796e3bbe8b04e1b38b5f4b76f19f26beac19401d74549785' 
  AND (
    token = 'WHVLjfqMMga8EUDmu5LC4gbeOpy8Ujtuk7zMaijLhkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034