UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QBQD177cX+QeY4P/iO6vcyt5YbodmtYrYWKc1IgEeJg=' 
WHERE 
  key_id = '4c8ef4fceedac2a316afec3cdf87385d6a0bd411616570e3be80368722fe3269' 
  AND (
    token = 'QBQD177cX+QeY4P/iO6vcyt5YbodmtYrYWKc1IgEeJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039