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

Query time 0.00023